<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        canvas{
            border: 1px solid red;
        }
    </style>
</head>
<body>
    <canvas width="400" height="300"></canvas>
    <script>
        const canvas = document.querySelector('canvas')
        const ca = canvas.getContext('2d')
        ca.moveTo(100,100)
        ca.lineTo(300,300)
        ca.strokeStyle = 'blue'
        ca.stroke()

        ca.moveTo(200,200)
        ca.lineTo(100,200)
        ca.stroke()

        ca.moveTo(400,200)
        ca.lineTo(100,200)
        ca.strokeStyle = 'orangered'
        ca.stroke()
    </script>
</body>
</html>